package com.caleble.sample.aspect;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.context.annotation.Scope;
import org.springframework.core.Ordered;
import org.springframework.stereotype.Component;

/*@Component
@Scope("prototype")
@Aspect*/
public class RecordLogAspect implements Ordered {

	private int order = 1;
/*
	@Pointcut("!within(com.caleble.sample.dao.*)")
	private void logOperation() {
	}

	// @Before，@AfterReturning，@AfterThrowing，@After
	@Around("com.caleble.sample.aspect.RecordLogAspect.logOperation()")
	public Object redordLogAround(ProceedingJoinPoint pjp) throws Throwable {

		System.out.println("Log recorded before method execute was called ===================");
		Object retVal = pjp.proceed();
		System.out.println("Log recorded after method execute was called ===================");

		return retVal;
	}
*/
	public int getOrder() {
		return order;
	}
}